package binaryOctopus;

/**
* The coordinates class encapsulate the row and column of 
* one cell in a 2-D coordinate system.
*/
public class Coordinates 
{
	//Coordinates only consist of a row and col #
	private int row, column;
	
	/**
	 * Constructor thats sets coordinates to specified valuess
	 * @param row Row value
	 * @param column Column value
	 */
	public Coordinates(int row, int column)
	{
		//checks for class invariance
		if(row >= 0 && column >= 0)
		{
			this.row = row;
			this.column = column;
		}
		//exits program if a negative coordinate is entered
		else
		{
			System.exit(0);
		}
	}

	/**
	 * @return Returns row of coordinate
	 */
	public int getRow() 
	{
		return row;
	}

	/**
	 * @return Returns column of coordinate
	 */
	public int getColumn() 
	{
		return column;
	}
	
	public String toString()
	{
		return row + ", " + column;
	}
}
